/*
 * @Author: your name
 * @Date: 2021-04-24 19:09:53
 * @LastEditTime: 2021-04-24 19:18:50
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /admin/src/components/braftEditor/index.tsx
 */
import React, { useState } from 'react'
import BraftEditor, { EditorState } from 'braft-editor'
import 'braft-editor/dist/index.css'
interface IProps {
  content: React.ReactNode;
  onChange: (editorState: EditorState) => void
}

const BraftEditorComponent = (props: IProps) => {
  return (
    <BraftEditor value={BraftEditor.createEditorState(props.content)} onChange={props.onChange} />
  )
}
export default BraftEditorComponent